﻿<UserControl x:Class="Atlanchim.Crm.Mui.Pages.Contacts.PageEditContact"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             xmlns:lmondeilConverters="clr-namespace:Atlanchim.Crm.Mui.Pages.Contacts"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="20"/>
            <RowDefinition Height="20"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--Entête-->
        <TextBlock Text="Contact" Style="{StaticResource Heading2}" />

        <!--Actions-->
        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
            <mui:ModernButton Content="Enregistrer"
                          Command="{Binding Path=SaveCommand}" CommandParameter="{Binding}"
                          IconData="{DynamicResource LmondeilSaveButtonPath}" Foreground="{DynamicResource LmondeilSaveButtonColor}" />
            <mui:ModernButton Content="Annuler"
                              Margin="10,0,0,0"
                          Command="{Binding Path=CancelCommand}" CommandParameter="{Binding}"
                          IconData="{DynamicResource LmondeilCancelButtonPath}" Foreground="{DynamicResource LmondeilCancelButtonColor}" />
        </StackPanel>

        <!--informations sur le Contact-->
        <Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="5"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="40"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="30"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <Rectangle Grid.Column="0" Grid.RowSpan="7" Fill="{DynamicResource ResourceKey=ContactColor}" Margin="0"/>

            <TextBlock Text="Nom" Grid.Row="0" Grid.Column="0"
                     VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0" Style="{DynamicResource MandatoryTextBlock}" />
            <TextBox Text="{Binding Contact.Nom, FallbackValue=[Nom]}" Grid.Row="0" Grid.Column="2" 
                     VerticalAlignment="Center" FontSize="16"/>

            <TextBlock  Text="Prénom" Grid.Row="1" Grid.Column="0"
                     VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0" Style="{DynamicResource MandatoryTextBlock}" />
            <TextBox Text="{Binding Contact.Prenom, FallbackValue=[Prénom]}" 
                       Grid.Row="1" Grid.Column="2" VerticalAlignment="Center" />

            <TextBlock  Text="Sexe" Grid.Row="2" Grid.Column="0"
                     VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0" />
            <ComboBox Text="{Binding Contact.Sexe, FallbackValue=[Sexe]}" MinWidth="80px"
                Grid.Row="2" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Left">
                <ListBoxItem Content="M" ToolTip="Masculin" />
                <ListBoxItem Content="F" ToolTip="Féminin"/>
            </ComboBox>

            <TextBlock  Text="Langue" Grid.Row="3" Grid.Column="0"
                     VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0" />
            <ComboBox Text="{Binding Contact.Langue}"
                Grid.Row="3" Grid.Column="2" VerticalAlignment="Center" IsEditable="True" HorizontalAlignment="Left" MinWidth="80px">
                <ListBoxItem Content="FR" ToolTip="Français" />
                <ListBoxItem Content="EN" ToolTip="Anglais"/>
            </ComboBox>

            <TextBlock  Text="Fonction" Grid.Row="4" Grid.Column="0"
                     VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0" />
            <TextBox Text="{Binding Contact.Fonction, FallbackValue=[Fonction]}" 
                       Grid.Row="4" Grid.Column="2" VerticalAlignment="Center" />

            <TextBlock  Text="Origine" Grid.Row="5" Grid.Column="0"
                     VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0" />
            <TextBox Text="{Binding Contact.Origine, FallbackValue=[Origine]}" 
                       Grid.Row="5" Grid.Column="2" VerticalAlignment="Center" />

            <TextBlock  Text="Commentaires" Grid.Row="6" Grid.Column="0"
                     VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,8,10,0" />
            <TextBox Text="{Binding Contact.Commentaire, FallbackValue=[Commentaire]}" Margin="0, 4, 0, 0" 
                       Grid.Row="6" Grid.Column="2" AcceptsReturn="True" />

        </Grid>

        <!--Informations connexes-->

    </Grid>
</UserControl>
